import 'package:ball_lion/utils/sp_utils.dart';

class ChannelAreaEntity {
  String? area;
  List<ChannelCountryEntity>? list;

  ChannelAreaEntity.fromJson(Json json) {
    area = json['area'];
    final l1 = json['list'];
    if (l1 != null && l1 is List) {
      list = l1.map((e) => ChannelCountryEntity.fromJson(e)).toList();
    }
  }
}

class ChannelCountryEntity {
  String? country;
  List<ChannelEntity>? list;

  ChannelCountryEntity.fromJson(Json json) {
    country = json['country'];
    final l1 = json['list'];
    if (l1 != null && l1 is List) {
      list = l1.map((e) => ChannelEntity.fromJson(e)).toList();
    }
  }
}

class ChannelEntity {
  String? area;
  String? country;
  String? endTime;
  int? hot;
  int? channelId;
  String? channelLogo;
  String? channelName;
  int? level;
  String? nameChs;
  String? nameEn;
  double? progress;
  String? rule;
  List<String>? seasonIdList;
  List<String>? seasonList;
  String? seasons;
  String? seasonsId;
  int? sourceLeagueId;
  String? startTime;
  int? transfer;
  int? type;
  int? weight;
  int? isFocus;

  ChannelEntity(
      {this.area,
      this.country,
      this.endTime,
      this.hot,
      this.channelId,
      this.channelLogo,
      this.channelName,
      this.level,
      this.nameChs,
      this.nameEn,
      this.progress,
      this.rule,
      this.seasonIdList,
      this.seasonList,
      this.seasons,
      this.seasonsId,
      this.sourceLeagueId,
      this.startTime,
      this.transfer,
      this.type,
      this.weight,
      this.isFocus});

  ChannelEntity.fromJson(Map<String, dynamic> json) {
    area = json['area'];
    country = json['country'];
    endTime = json['endTime'];
    hot = json['hot'];
    channelId = json['leagueId'];
    channelLogo = json['leagueLogo'];
    channelName = json['leagueName'];
    level = json['level'];
    nameChs = json['nameChs'];
    nameEn = json['nameEn'];
    progress = json['progress'];
    rule = json['rule'];
    seasonIdList = json['seasonIdList']?.cast<String>();
    seasonList = json['seasonList']?.cast<String>();
    seasons = json['seasons'];
    seasonsId = json['seasonsId'];
    sourceLeagueId = json['sourceLeagueId'];
    startTime = json['startTime'];
    transfer = json['transfer'];
    type = json['type'];
    weight = json['weight'];
    isFocus = json['isFocus'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['area'] = this.area;
    data['country'] = this.country;
    data['endTime'] = this.endTime;
    data['hot'] = this.hot;
    data['leagueId'] = this.channelId;
    data['leagueLogo'] = this.channelLogo;
    data['leagueName'] = this.channelName;
    data['level'] = this.level;
    data['nameChs'] = this.nameChs;
    data['nameEn'] = this.nameEn;
    data['progress'] = this.progress;
    data['rule'] = this.rule;
    data['seasonIdList'] = this.seasonIdList;
    data['seasonList'] = this.seasonList;
    data['seasons'] = this.seasons;
    data['seasonsId'] = this.seasonsId;
    data['sourceLeagueId'] = this.sourceLeagueId;
    data['startTime'] = this.startTime;
    data['transfer'] = this.transfer;
    data['type'] = this.type;
    data['weight'] = this.weight;
    data['isFocus'] = this.isFocus;
    return data;
  }
}
